import { Module } from '@nestjs/common'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { ConfigService } from './config.service';
import { DbService } from './db.service';
import { WcbModule } from './wcb/wcb.module';
import { TestModule } from './test/test.module';

@Module({
  imports: [WcbModule, TestModule],
  controllers: [AppController],
  providers: [
    AppService,
    ConfigService,
    {
      provide:'DbService',
      inject:['configService'],
      useFactory : async (configService)=>{
        // return new DbService(configService);
        return new Promise((r)=>{
          setTimeout(()=>{
            r('wcb')
          },3000)
        })
      }
    }
],
})
export class AppModule {}
